﻿using System.Web.Mvc;
using RestUpMVC.BlogService.Resources;

namespace RestUpMVC.BlogService
{
    public class MvcApplication : System.Web.HttpApplication
    {
        public static void RegisterGlobalFilters(GlobalFilterCollection filters)
        {
            filters.Add(new HandleErrorAttribute());
        }

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);

            RestUpMvcConfiguration.Instance
                .SetBaseUri("api")
                .RegisterResource(typeof (Blog))
                .RegisterResource(typeof (Post));

        }
    }
}